package com.tuanzi.loan.business.service.receipt.product;

import java.util.List;

import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.entity.receipt.product.ReceiptProductCondition;
import com.tuanzi.loan.business.entity.receipt.product.ReceiptProductInfo;
import com.tuanzi.loan.core.service.BaseAuditService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.receipt.product.ReceiptProductInfoSearchRequest;
import com.tuanzi.loan.vo.response.receipt.product.ReceiptProductInfoSearchResponse;
import com.tuanzi.server.loan_base.constant.LoanReceiptProductStatus;

/**
 * @author Ray 2017/09/21
 */
public interface ReceiptProductInfoService extends BaseAuditService<ReceiptProductInfo, Long> {

	/**
	 * 查询所有上下线的产品
	 *
	 * @param pageSearcher
	 * @return
	 */
	Page<ReceiptProductInfoSearchResponse> list(PageSearcher<ReceiptProductInfoSearchRequest> pageSearcher);

	ReceiptProductInfo findEarliestProductInfoByUserIdAndStatusIn(String userId, List<LoanReceiptProductStatus> statusIn);

	List<ReceiptProductInfo> findAllProductIdAndName();

	void sortUp(Long productId);

	void sortDown(Long productId);

	void onlineOneKey(Long productId);

	void offlineOneKey(Long productId);

	void updateProductInfoAndConditionByStatus(ReceiptProductInfo receiptProductInfo, ReceiptProductCondition receiptProductCondition, LoanReceiptProductStatus status);
}
